﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Diagnostics;
using Microsoft.Practices.EnterpriseLibrary.Logging;

namespace WebStudio.Framework.Helper
{
    public static class LoggerHelper
    {
        // Methods
        public static void WriteError(object message)
        {
            Logger.Write(message, "常规异常", 0, 0, TraceEventType.Error, message.ToString());
        }

        public static void WriteError(object message, IDictionary<string, object> properties)
        {
            Logger.Write(message, "常规异常", 0, 0, TraceEventType.Error, message.ToString(), properties);
        }

        public static void WriteError(object message, string title)
        {
            Logger.Write(message, "常规异常", 0, 0, TraceEventType.Error, title);
        }

        public static void WriteError(object message, string title, IDictionary<string, object> properties)
        {
            Logger.Write(message, "常规异常", 0, 0, TraceEventType.Error, title, properties);
        }

        public static void WriteInfo(object message)
        {
            Logger.Write(message, "常规信息", 3, 0, TraceEventType.Information, message.ToString());
        }

        public static void WriteInfo(object message, IDictionary<string, object> properties)
        {
            Logger.Write(message, "常规信息", 3, 0, TraceEventType.Information, message.ToString(), properties);
        }

        public static void WriteInfo(object message, string title)
        {
            Logger.Write(message, "常规信息", 3, 0, TraceEventType.Information, title);
        }

        public static void WriteInfo(object message, string title, IDictionary<string, object> properties)
        {
            Logger.Write(message, "常规信息", 3, 0, TraceEventType.Information, title, properties);
        }

        public static void WriteWarning(object message)
        {
            Logger.Write(message, "常规警告", 0, 0, TraceEventType.Warning, message.ToString());
        }

        public static void WriteWarning(object message, IDictionary<string, object> properties)
        {
            Logger.Write(message, "常规警告", 0, 0, TraceEventType.Warning, message.ToString(), properties);
        }

        public static void WriteWarning(object message, string title)
        {
            Logger.Write(message, "常规警告", 0, 0, TraceEventType.Warning, title);
        }

        public static void WriteWarning(object message, string title, IDictionary<string, object> properties)
        {
            Logger.Write(message, "常规警告", 0, 0, TraceEventType.Warning, title, properties);
        }
    }


}
